<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head th:replace="_fragments :: head(~{::title})">
    <meta charset="UTF-8">
    <title>标签</title>
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/semantic-ui/2.2.4/semantic.min.css">
    <link rel="stylesheet" href="../static/css/me.css">
    <link>
</head>
<body>
<!--导航栏-->
<nav th:replace="_fragments::menu(3)" class="ui  inverted attached segment m-padded-tb-mini m-shadow-small">
    <div class="ui container">
        <div class="ui inverted secondary stackable menu">
            <h2 class="ui teal header item ">Blog</h2>
            <a class="m-item item m-mobile-hide"><i class="home icon"></i>首页</a>
            <a class="m-item item m-mobile-hide"><i class="idea icon"></i>分类</a>
            <a class="active m-item item m-mobile-hide"><i class="tags icon"></i>标签</a>
            <a class="m-item item m-mobile-hide"><i class="clone icon"></i>归档</a>
            <a class="m-item item m-mobile-hide"><i class="info icon"></i>我的</a>
            <div class="right m-item item m-mobile-hide">
                <div class="ui icon inverted transparent input  m-margin-tb-tiny">
                    <input type="text" placeholder="搜索">
                    <i class="search link icon"></i>
                </div>
            </div>
        </div>
    </div>
    <a href="#" class="ui menu toggle black icon button m-right-top m-mobile-show">
        <i class="sidebar icon"></i>
    </a>
</nav>

<!--中间部分-->
<div class="m-container-small m-padded-tb-big ">
    <div class="container">
        <!--header-->
        <div class="ui top attached segment">
            <div class="ui middle aligned two column grid">
                <div class="column">
                    <h3 class="ui teal header">标签</h3>
                </div>
                <div class="right aligned column">
                    共 <h2 class="ui orange header m-inline-block" th:text="${tags.size()}">14</h2> 个
                </div>
            </div>
        </div>

        <!--标签-->
        <div class="ui attached segment m-padded-tb-large">
            <a th:each="tag:${tags}"
               th:href="@{'/tags/'+${tag.id}}"
               th:classappend="${tag.id==activeTagId} ? 'teal'"
               href="#"  class="ui basic left pointing large label m-margin-tb-tiny">
                <span th:text="${tag.name}">方法论</span>
                <div th:text="${tag.getBlogs().size()}" class="detail">23</div>
            </a>
           <!--/*-->
            <a href="#" target="_blank" class="ui  basic left pointing large label m-margin-tb-tiny">
                方法论<div class="detail">23</div>
            </a>
            <!--*/-->
        </div>

        <!--博客列表-->
        <div class="ui top attached teal segment">
            <div class="ui error message m-padded-tb-large" th:if="${page.totalElements==0}">
                <div class="ui container">
                    <p>暂无该id标签，请查看其它标签文章</p>
                </div>
            </div>
            <div class="ui padded vertical segment m-padded-tb-large" th:each="blog : ${page.content}">
                <div class="ui middle aligned mobile reversed stackable grid">
                    <div class="eleven wide column">
                        <h3 class="ui header">
                            <a  th:href="@{/blog/{id}(id=${blog.id})}" target="_blank" href="#" class="m-black" th:text="${blog.title}">标题啥大事的机会手机卡哈</a>
                        </h3>
                        <p class="m-text" th:text="|${blog.description}......|">
                            正确做好任何一件事情的前提是清晰、正确的理解目标。而事实是，我们很多人很多时候根本没有对目标正确的定义，甚至根本从来就没有想过，只是大家都那么做而已…..
                        </p>
                        <div class="ui middle aligned grid">
                            <div class="eleven wide column">
                                <div class="ui mini horizontal link list">
                                    <div class="item">
                                        <img th:src="@{${blog.user.avatar}}" class="ui avatar image m-margin-bottom-tiny"  src="https://picsum.photos/id/1005/100/100" alt="avatar">
                                        <div class="content"><a  th:text="${blog.user.nickname}" href="#" class="header m-margin-bottom-tiny">定春</a></div>
                                    </div>
                                    <div class="item">
                                        <i class="calendar icon m-margin-bottom-mini" ></i><span th:text="${#dates.format(blog.updateTime,'yyyy-MM-dd')}">2021-08-15</span>
                                    </div>
                                    <div class="item">
                                        <i class="eye icon m-margin-bottom-mini" ></i><span th:text="${blog.views}">81203</span>
                                    </div>
                                </div>
                            </div>
                            <div class="right aligned five wide column">
                                <a href="#" target="_blank" th:text="${blog.type.name}"
                                   class="ui teal basic  label">认知升级</a>
                            </div>
                        </div>
                    </div>
                    <div class="five wide column">
                        <a href="#"  th:href="@{/blog/{id}(id=${blog.id})}" target="_blank">
                            <img th:src="@{${blog.firstPicture}}" class="ui rounded image" src="https://picsum.photos/id/1005/800/450" alt="">
                        </a>
                    </div>

                    <div class="sixteen wide column">
                        <a href="#"
                           th:each="tag : ${blog.tags}"
                           th:href="@{/tags/{id}(id=${tag.id})}"
                           class="ui basic left pointing label m-padded-tb-mini m-text-thin"
                           th:classappend="${tag.id==activeTagId} ? 'teal'"
                           th:text="${tag.name}">方法论</a>
                    </div>
                </div>
            </div>
        </div>

        <!--分页-->
        <div class="ui attached segment" th:if="${page.totalPages>1}">
            <div class="ui middle aligned four column grid">
                <div class="column">
                    <a th:href="@{'/tags/'+${activeTagId}(pageNum=${page.number})}"  th:unless="${page.first}" href="#" class="ui mini teal basic  button">上一页</a>
                </div>
                <div class="ui menu">
                    <a class="item" th:each="pageNum:${#numbers.sequence(1, page.totalPages )}"
                       th:href="@{'/tags/'+${activeTagId}(pageNum=${pageNum})}"
                       th:classappend="${pageNum==(page.number+1)} ? 'active'"
                       th:text="${pageNum}">1</a>
                    <!--/*-->
                    <div class="item">2</div>
                    <div class="item">3</div>
                    <div class="item">4</div>
                    <div class="item">...</div>
                    <div class="item">100</div>
                    <!--*/-->
                </div>
                <div class="right aligned column">
                    <a th:href="@{'/tags/'+${activeTagId}(pageNum=${page.number}+2)}" th:unless="${page.last}" href="#" class="ui mini teal basic  button">下一页</a>
                </div>
            </div>
        </div>





    </div>
</div>

<br>
<br>

<!--底部-->
<footer th:replace="_fragments::footer" class="ui inverted vertical segment m-padded-tb-massive">
    <div class="ui center aligned  container">
        <div class="ui inverted divided stackable grid">
            <div class="three wide column">
                <div class="ui inverted link list">
                    <div class="item">
                        <img src="../static/images/wechat.jpg" class="ui rounded image" alt="" style="width: 110px">
                    </div>
                </div>
            </div>
            <div class="three wide column">
                <h4 class="ui inverted header m-text-thin m-text-spaced ">最新博客</h4>
                <div class="ui inverted link list m-text-thin m-text-spaced m-opacity-mini">
                    <a href="#" class="item">用户故事 User story</a>
                    <a href="#" class="item">用户故事 User story</a>
                    <a href="#" class="item">用户故事 User story</a>
                </div>
            </div>
            <div class="three wide column">
                <h4 class="ui inverted header m-text-thin m-text-spaced ">联系我</h4>
                <div class="ui inverted link list m-text-thin m-text-spaced m-opacity-mini">
                    <a href="#" class="item m-text-lined">Email: xingzq.dc@foxmail.com</a>
                    <a href="#" class="item">QQ: 1961329303</a>
                </div>
            </div>
            <div class="seven wide column">
                <h4 class="ui inverted header m-text-thin m-text-spaced ">定春</h4>
                <p class="m-text-thin m-text-spaced m-opacity-mini">
                    这是我的个人博客，也是我第一个上线的项目，我未来职业规划是当一名Java开发工程师，并朝着架构师的目标努力前行！</p>
            </div>
        </div>
        <div class="ui inverted section divider"></div>
        <p class="m-text-thin m-text-spaced m-opacity-tiny">Copyright © 2021 - 2022 Dingchun Designed by Dingchun</p>
    </div>
</footer>

<script src="https://cdn.jsdelivr.net/npm/jquery@3.2/dist/jquery.min.js"></script>
<script src="https://cdn.jsdelivr.net/semantic-ui/2.2.4/semantic.min.js"></script>

<script>
    /*隐藏导航栏右上角图标（PC端时）*/
    $('.menu.toggle').click(function () {
        $('.m-item').toggleClass('m-mobile-hide');
    });


    $('#newblog-container').load(/*[[@{/footer/newblog}]]*/"/footer/newblog");
</script>

</body>
</html>